<html>
	<head>
		<?php
			require 'addTinyMce.php'; 
		?>
	</head>
	<body>
		<?php 
			require '../db_config.php';
			
			if (isset($_POST['newEnglishAbout']) and isset($_POST['newFrenchAbout'])) {
				mysql_connect(__DB_HOST__, __DB_USER__, __DB_PASSWORD__) or die(mysql_error());
				mysql_query('use ' . __DB_DATABASE__ . ';') or die('Invalid query: ' . mysql_error());
				mysql_query('UPDATE site_fields SET en=\'' . $_POST['newEnglishAbout'] . 
				'\', fr=\'' . $_POST['newFrenchAbout'] . '\'WHERE description like \'about_%\';') or die('Invalid query: ' . mysql_error());
				header('Location: index.php');				
			}
		
			$content = '';
			
			mysql_connect(__DB_HOST__, __DB_USER__, __DB_PASSWORD__) or die(mysql_error());
			mysql_query('use ' . __DB_DATABASE__ . ';') or die('Invalid query: ' . mysql_error());
			$result = mysql_query('SELECT en,fr FROM site_fields WHERE description like \'about_%\';') or die('Invalid query: ' . mysql_error());
			$arr = mysql_fetch_array($result);
			$english = $arr['en'];
			$french = $arr['fr'];
		?>
		<form action="about.php" method="post">
			<p>
				English:<br />
				<textarea name="newEnglishAbout" cols="100" rows="10"><?php echo $english; ?></textarea>
			</p>
			<p>
				French:<br />
				<textarea name="newFrenchAbout" cols="100" rows="10"><?php echo $french; ?></textarea>
			</p>
			<p>
				<input type="submit" title="Apply"/>
				<input type="button" value="Cancel" onClick="window.location.href='index.php?task=about';" />
			</p>
		</form>
	</body>
</html>